export default [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    meta: { name: 'home', title: '首页' },
    component: () => import('@/views/Home.vue')
  },
  {
    path: '/auth/login',
    name: 'login',
    meta: { name: 'login', title: '登录' },
    component: () => import('@/views/auth/login.vue')
  },
  {
    path: '/auth/register',
    name: 'register',
    meta: { name: 'register', title: '注册' },
    component: () => import('@/views/auth/register.vue')
  },
  {
    path: '/error',
    name: 'error',
    redirect: '/error/404',
    children: [
      {
        path: '/error/404',
        name: 'error_404',
        meta: { name: 'error_404', title: '404' },
        component: () => import('@/views/error/404.vue')
      },
      {
        path: '/error/500',
        name: 'error_500',
        meta: { name: 'error_500', title: '500' },
        component: () => import('@/views/error/500.vue')
      }
    ]
  },
  {
    path: '/lesson',
    name: 'lesson',
    meta: { name: 'lesson', title: '课程中心' },
    component: () => import('@/views/lesson/index.vue')
  },
  {
    path: '/lesson/:id',
    name: 'lesson_detail',
    meta: { name: 'lesson_detail', title: '课程详情' },
    component: () => import('@/views/lesson/detail.vue')
  },
  {
    path: '/lesson/:id/buy',
    name: 'lesson_buy',
    meta: { name: 'lesson_buy', title: '购买课程' },
    component: () => import('@/views/my/order/create.vue')
  },
  {
    path: '/my',
    name: 'my',
    meta: { name: 'my', title: '个人中心' },
    component: () => import('@/views/my/index.vue')
  },
  {
    path: '/my/info',
    name: 'my_info',
    meta: { name: 'my_info', title: '个人资料' },
    component: () => import('@/views/my/info.vue')
  },
  {
    path: '/my/order',
    name: 'my_order',
    meta: { name: 'my_order', title: '订单' },
    component: () => import('@/views/my/order/index.vue')
  },
  {
    path: '/my/order/:sn',
    name: 'my_order_detail',
    meta: { name: 'my_order_detail', title: '订单详情' },
    component: () => import('@/views/my/order/detail.vue')
  },
  {
    path: '/my/lesson',
    name: 'my_lesson',
    meta: { name: 'my_lesson', title: '我的课程' },
    component: () => import('@/views/my/lesson/index.vue')
  },
  {
    path: '/my/lesson/:id',
    name: 'my_lesson_detail',
    meta: { name: 'my_lesson_detail', title: '学习中心' },
    component: () => import('@/views/my/lesson/detail.vue')
  }
]
